<!--
	创建时间：2017年2月7日 12:08:45
	功能描述： 顶部， 
-->
<div class="header-top">
	<div class="header-box">
		<font id="login-info" class="login-info"></font>
		<ul>
			<li><a class="menu-hd home" href="SHOP_MAIN/index.html" target="_top"><i></i>商城首页</a></li>
			<li class="menu-item">
				<div class="menu">
					<a class="menu-hd myinfo" href="SHOP_MAIN/member/index.html" target="_blank"><i></i> 个人中心 <b></b></a>
					<div id="menu-2" class="menu-bd">
						<span class="menu-bd-mask"></span>
						<div class="menu-bd-panel">
							<a href="SHOP_MAIN/member/orderlist.html" target="_blank">已买到的宝贝</a>
							<a href="SHOP_MAIN/member/addresslist.html" target="_blank">我的地址管理</a>
							<a href="SHOP_MAIN/member/goodscollectionlist.html" target="_blank">我收藏的宝贝</a>
						</div>
					</div>
				</div>
			</li>
			<li class="menu-item cartbox"><a class="menu-hd cart" href="SHOP_MAIN/member/cart.html" target="_top"><i></i>&nbsp;购物车</a></li>
			<li><a class="menu-hd" target="_blank" href="ADMIN_MAIN.html">卖家中心</a></li>
			<li class="menu-item">
				<div class="menu">
					<a class="menu-hd we-chat"
						href="javascript:;" target="_top"> <i></i>
						关注商城 <b></b>
					</a>
					<div id="menu-5" class="menu-bd we-chat-qrcode">
						<span class="menu-bd-mask"></span> <a target="_top"> <img src="__UPLOAD__/{$web_info['web_qrcode']}" alt="官方微信"></a>
						<p class="font-14">关注官方微信</p>
					</div>
				</div>
			</li>
			<li class="menu-item">
				<div class="menu">
					<a href="SHOP_MAIN/helpcenter/index.html" class="menu-hd site-nav" target="_blank"> 商家支持 <b></b></a>
					<div id="menu-7" class="menu-bd site-nav-main">
						<span class="menu-bd-mask"></span>
						<div class="menu-bd-panel">
							<div class="site-nav-con">
								<a href="SHOP_MAIN/helpcenter/index.html?id=2" target="_blank" title="常见问题">常见问题</a>
								<a href="SHOP_MAIN/helpcenter/index.html?id=7" target="_blank" title="网上支付">网上支付</a>
								<a href="SHOP_MAIN/helpcenter/index.html?id=5" target="_blank" title="验货与签收">验货与签收</a>
								<a href="SHOP_MAIN/helpcenter/index.html?id=9" target="_blank" title="退款说明">退款说明</a>
<!-- 								<a href="SHOP_MAIN/helpcenter/index.html?id=12" target="_blank" title="商家入驻">商家入驻</a> -->
							</div>
						</div>
					</div>
				</div>
			</li>
			<li class="menu-item"><a href="SHOP_MAIN/helpcenter/index.html" class="menu-hd site-nav" target="_blank">帮助中心</a></li>
		</ul>
	</div>
</div>

<script type="text/javascript">
$.ajax({
	type:"post",
	url:"SHOP_MAIN/Components/getLoginInfo",
	success:function(data){
		var login_info_html='';
		if(data!=null && data!=""){
// 			if(data["user_info"]["nick_name"]!= null && data["user_info"]["nick_name"] != ""){
				login_info_html='<a class="sn-login main-color" href="SHOP_MAIN/member/index.html" target="_top">'+data["user_info"]["nick_name"]+'</a><em>欢迎您回来！</em><a class="sn-register" href="javascript:logout();" target="_top">退出</a>';
				$('div.login-info').html('<font id="login-info" class="login-info NS-USER-ALREADY-LOGIN"><em><a href="#" target="_blank" class="color NS-USER-NAME"></a></em><a href="javascript:logout();" data-method="post" class="logout bg-color">退出</a></font>');
// 			}
		}else{
			login_info_html='<em>欢迎来到{$title}</em><a class="login color" href="SHOP_MAIN/login/index.html" target="_top">请登录</a><a class="register" href="SHOP_MAIN/login/register.html" target="_top">免费注册</a>';	
			$('div.login-info').html('<font id="login-info" class="login-info"><a class="login color" href="SHOP_MAIN/login/index.html" target="_top">登录</a><a class="register bg-color" href="SHOP_MAIN/login/register.html" target="_top">免费注册</a></font>');
		}
		$('#login-info').html(login_info_html);
	}
});

//退出登录
function logout(){
	$.ajax({
		url: "SHOP_MAIN/Member/logOut",
		type: "post",
		success: function (res) {
			if (res['code'] > 0) {
				location.href='SHOP_MAIN/index';
			} else {
				if(res["message"]!=null){
					$.msg(res["message"]);
				}
			}
		}
	})
}
</script>